package designpattern.struct.decorator;/**
 * Description
 * <p>
 * </p>
 * DATE 2020/3/29.
 *
 * @author cuihao.
 */

/**
 * @program: ch-general
 * @description:
 * @author: cuihao
 * @create: 2020-03-29 23:36
 **/
public class Enhance2Decorator extends Decorator {
    public Enhance2Decorator(Component component) {
        super(component);
    }

    // 定义自己的修饰逻辑
    private void enhanceMethod() {
        System.out.println("第2次修饰");
    }

    // 重写父类的方法
    @Override
    public void cost() {
        this.enhanceMethod();
        super.cost();
    }
}
